package org.chainsale.common;

import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.Properties;

import prefuse.util.io.IOLib;

public class Info {

	public static final Info info = new Info();
	
	static {
		
		
		Properties pros = new Properties();
		
//		File infoFile = new File("");// "/access_info.properties"
		InputStream is = null;
		try {
//			is = new FileInputStream(infoFile);
			URL url = IOLib.urlFromString("/info.properties");
			is = url.openStream();
			pros.load(is);
			
		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			try {
				if (is != null) is.close();
			} catch (IOException e2) {
				e2.printStackTrace();
			}
			
		}
		
		info.setMoneyPerShare(Integer.valueOf(pros.getProperty("money.per.share")));
		
	}
	
	public static final Info getInstance() {
		return info;
	}
	
	private int moneyPerShare;

	private Info() {
		
	}
	
	public int getMoneyPerShare() {
		return moneyPerShare;
	}

	public void setMoneyPerShare(int moneyPerShare) {
		this.moneyPerShare = moneyPerShare;
	}
	
	public static void main(String[] args) {
		
		System.out.println(getInstance().getMoneyPerShare());
	}
	
}
